(function () {
    var States = [
        {
            name: 'login',
            url: '/login',
            component: 'xxLogin'
        }, {
            name: 'register',
            url: '/register',
            component: 'xxRegister'
        }, {
            name: 'registerCon',
            url: '/registerCon',
            component: 'xxRegisterCon'
        },{
            name: 'show',
            url: '/show',
            component: 'xxShow'
        },{                       //user
            name: 'show.home',
            url: '/home',
            component: 'xxHome'
        },
        {
            name: 'show.question',
            url: '/postQuestion',
            component: 'xxQuestion'
        },
        {
            name: 'show.show-all-essay',
            url: '/show-all-question',
            component: 'xxShowAllQuestion'
        },
        {
            name: 'show.show-all-essay-by-consultant-id',
            url: '/showAllQuestion/byConsultantId/{consultantId}',
            component: 'xxShowAllQuestionByConsultantId'
        },
        {
            name: 'show.get-essay-by-id',
            url: '/get-essay-by-id/{essayId}',
            component: 'xxShowQuestionById'
        },
        {
            name: 'show.person-info',
            url: '/user/personInfo/{username}',
            component: 'xxPersonInfo'
        },{
            name: 'show.recharge',
            url: '/user/recharge/{username}',
            component: 'xxRecharge'
        },
        {
            name: 'show.travel',
            url: '/domain/travel',
            component: 'xxTravel'
        },
        {
            name: 'show.career',
            url: '/domain/career',
            component: 'xxCareer'
        },
        {
            name: 'show.gym',
            url: '/domain/gym',
            component: 'xxGym'
        },
        {
            name: 'show.iDesign',
            url: '/domain/iDesign',
            component: 'xxIDesign'
        },
        {
            name: 'show.car',
            url: '/domain/car',
            component: 'xxCar'
        },
        {
            name: 'show.law',
            url: '/domain/law',
            component: 'xxLaw'
        },
        {
            name: 'show.getLog',
            url: '/admin/get-all-log',
            component: 'xxGetLog'
        },
        {
            name: "otherwise",
            url: "*path",
            controller: function ($state) {
                $state.go('show.home');
            }
        }
    ];
    angular.module('app')
        .constant('ROUTER_CONSTANT', States);
})();